package consumer;


import com.dubbo.test.infterface.DemoService;
import com.dubbo.test.infterface.ZookeeperTestService;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wbc
 * @description
 * @date 2023/10/16 14:34
 */
@RestController("/")
public class TestController {

    private static final Logger log = LoggerFactory.getLogger(TestController.class);
    @Reference
    private DemoService demoService;

    @Reference
    private ZookeeperTestService zookeeperTestService;

    @RequestMapping("/testHello")
    public String test(){
        String hello = demoService.sayHello("test");
        log.info("hello: {}", hello);
        // System.out.println(demoService.sayHello("dubbo 实现远程调用"));
        zookeeperTestService.sayZookeeper(" success");
        return hello;
    }
}
